<?php
class Default_Model_category extends Zend_Db_Table
{
	public function get_list_solution($id)
	{
	    $ns = new Zend_Session_Namespace('lang');
	    $lang=$ns->lang;
		$db = Zend_Registry::get('connectDb');
		$select = $db->select()
		          ->from('article_solution', array('id','title','introtext','images','fulltext')) 
		          ->where('published = ?', '1')
		          ->where('language_id = ?',$lang)
		          ->where('cat_id 	 = ?',$id);
		$result = $db->fetchAll($select);
	    return $result;          
		
	}	
	
	public function get_list_product($id)
	{
	    $ns = new Zend_Session_Namespace('lang');
	    $lang=$ns->lang;
		$db = Zend_Registry::get('connectDb');
		$select = $db->select()
		          ->from('details_product', array('id','title','introtext','images','fulltext')) 
		          ->where('published = ?', '1')
		          ->where('language_id = ?',$lang)
		          ->where('category_product_id 	 = ?',$id);
		$result = $db->fetchAll($select);
	    return $result;          
		
	}	
	
	public function get_title_product($id)
	{
	    $ns = new Zend_Session_Namespace('lang');
	    $lang=$ns->lang;
		$db = Zend_Registry::get('connectDb');
		$select = $db->select()
		          ->from('category_product', array('id','title')) 
		          ->where('published = ?', '1')
		          ->where('language_id = ?',$lang)
		          ->where('id 	 = ?',$id)
		          ->order('id DESC');
		$result = $db->fetchAll($select);
	    return $result;     
	}	
	
	
}